package com.jk.customer.controller;

import com.jk.customer.entity.ProductEntity;
import com.jk.customer.entity.StatusTypeEntity;

import com.jk.customer.service.SellerWzyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

@Controller
public class SellerWzyController {
    @Autowired
    private SellerWzyService sellerWzyService;


    /**
     * 查询询图详情页面
     */
    @RequestMapping("wzyForGetPictureParticulars")
    @ResponseBody
    public Map wzyForGetPictureParticulars(String pid){
        return sellerWzyService.wzyForGetPictureParticulars(pid);
    }



    /**
     * 查询详情页面
     */
    @RequestMapping("wzyforgetparticulars")
    @ResponseBody
    public Map wzyforgetparticulars(HttpSession session){
        return sellerWzyService.wzyforgetparticulars(session);
    }


    /**
     * 跳转详情页面
      */
    @RequestMapping("particulars")
    public String particulars(String productId, HttpSession session){
        session.setAttribute("productId",productId);
        return "priceParticulars";
    }

    /**
     *
     * @return
     */
    @RequestMapping(value = "/toPrice")
    public String toPrice(){
        return "queryPriceTable";
    }

    /**
     *
     * @return
     */
    @RequestMapping(value = "/toLogin")
    public String toLogin(){
        return "login";
    }


    /**
     * 放弃报价
     */
    @RequestMapping("giveUpById")
    @ResponseBody
    public void giveUpById(String productId,HttpSession session){
        sellerWzyService.giveUpById(productId,session);
    }



    /**
     * 动态下拉  查询询价状态类型
     */
    @RequestMapping("getPriceSelectClass")
    @ResponseBody
    public List<StatusTypeEntity> getPriceSelectClass(){
        return sellerWzyService.getPriceSelectClass();
    }

    /**
     * 动态下拉  查询询图状态类型
     * @return
     */
    @RequestMapping("getPictureSelectClass")
    @ResponseBody
    public List<StatusTypeEntity> getPictureSelectClass(){
        return sellerWzyService.getPictureSelectClass();
    }


    /**
     * wzy
     * 查询询价单列表
     * @param product
     * @return
     */
    @RequestMapping("getCommonTable")
    @ResponseBody
    public List<ProductEntity> getCommonTable(ProductEntity product,HttpSession session){
        return sellerWzyService.getCommonTable(product,session);
    }

    /**
     * 查询询图单列表
     * @param product
     * @return
     */
    @RequestMapping("getPictureTable")
    @ResponseBody
    public List<ProductEntity> getPictureTable(ProductEntity product,HttpSession session){
        return sellerWzyService.getPictureTable(product,session);
    }


}
